<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
<title><?=lang('system_adminname')?> - Powered by <?=lang('system_name')?> <?=lang('system_version')?></title>
<link rel="stylesheet" type="text/css" href="<?=base_url('public/css/login.css')?>" />
<script type="text/javascript" src="<?=base_url('public/js/jquery.min.js')?>"></script>
<script type="text/javascript">
function login(){
	//var user_name=$.trim($("#user_name").val());
	//var user_pass=$.trim($("#user_pass").val());
	var form=$(document.loginform);
	$.ajax({
		type: form.attr('method'),
		url: form.attr('action'),
		data: form.serialize(),//"opt=ajax&user_name="+user_name+"&user_pass="+user_pass,
		success: function(msg){
			if(msg=='ok'){
				<?php if (isset($lose)&&$lose==1): ?>
				location.href=document.referrer
				<?php else: ?>
				location.href="<?=site_aurl('main')?>";
				<?php endif; ?>
			}else{
				if(msg=='error'){
					$("#msgtip").html("<?=lang('name_or_pass_error')?>");
				}else{
					$("#msgtip").html(msg);
				}
				flashing();
			}
		},
		beforeSend:function(){
			$("#msgtip").html("<?=lang('user_logining')?>");
		},
		error:function(XMLHttpRequest, textStatus, errorThrown){
			$("#msgtip").html(errorThrown);
			flashing();
		}
	});
}
function flashing(){
	$('#checkcodeimg').click();
}
$(document).keypress(function(e) {
if (e.which == 13)  
	login(); 
});
</script>
</head>
<body>
<div id="body"><form method="post" name="loginform" action="<?=site_aurl('login')?>" />
<table border="0" id="loginform">
<tr><td height="45" align="right"><?=lang('user_name')?></td><td align="left"><input type="text" class="text" name="user_name" id="user_name" ></td></tr>
<tr><td height="45" align="right"><?=lang('user_pass')?></td><td align="left"><input type="password" class="text" name="user_pass" id="user_pass" ></td></tr>
<tr><td height="45" align="right"><?=lang('user_check')?></td><td align="left"><input type="text" class="text" name="checkcode" id="checkcode" ><img src="<?=site_aurl('login/checkcode')?>?t=<?=time()?>" id="checkcodeimg" width="87" height="27" border="0" onclick="this.src='<?=site_aurl('login/checkcode')?>?t='+new Date().getTime()"></td></tr>
<tr><td colspan="2" height="45" ><span id="msgtip"></span><a href="javascript:void(0)" onclick="login()" id="loginbtn"><?=lang('btn_login')?></a></td></tr>
<tr><td colspan="2" height="20" class="footer"><?=lang('system_copy')?>  Powered by <a href="<?=lang('system_link')?>" target="_blank"><?=lang('system_name')?></a></td></tr>
</table>
</form>
</div>
</body>
</html>